Node-RED block in Snap4City Microservice library node-red-contrib-snap4city-user is "curved-line-series">

With this node you can add a curved line series graph to an existing dashboard or a new one created by the node to show curved line series graph.

Configurations

dashboard string
Dashboard title to which the curved line series graph will be added
widget string
Title that will have the widget containing the curved line series graph.

Inputs

A JSON array like the following:
[
    {
        "metricHighLevelType": "Sensor",
        "metricName": [The name of the Sensor],
        "smField": [A measure recorded by the sensor],
        "serviceUri": [Service Uri Of A Sensor]
    },
    {
        "metricHighLevelType": "MyKPI",
        "metricName": [The name of the MyKPI],
        "smField": [The type of the measure saved in the KPI],
        "serviceUri": [The ID of a KPI]
    },
    {
        "metricHighLevelType": "Dynamic",
        "metricName": [The name of the dynamic data],
        "smField": [The type of the dynamic data],
        "metricValueUnit": [The unit of the dynamic data],
        "value": [An array of array of timestamp and value]
    }
]
        

You can insert an arbitrary number of MyKPI and Sensor element inside the array. An example of the JSON array filled with correct data( copy in a function node for try):

var now = new Date();
var base =60*60*100;

msg.payload = [
    {
        "serviceUri": "http://www.disit.org/km4city/resource/tusc_weather_sensor_ow_3166540",
        "metricHighLevelType": "Sensor",
        "metricName": "tusc_weather_sensor_ow_3166540",
        "smField": "airTemperature",
    },
    {
        "serviceUri": "http://www.disit.org/km4city/resource/tusc_weather_sensor_ow_3176959",
        "metricHighLevelType": "Sensor",
        "metricName": "tusc_weather_sensor_ow_3176959",
        "smField": "airTemperature"
    },
    {
        "serviceUri": "17057458",
        "metricHighLevelType": "MyKPI",
        "metricName": "S4CTuscanyTrackerLocation",
        "metricType": "Temperature"
    },
    {
        "metricId": "",
        "metricHighLevelType": "Dynamic",
        "metricName": "BatteryTemperatureGalaxyNote",
        "smField": "Gradi Centigradi",
        "metricValueUnit": "°C",
        "values": [
                    [now-64*base, 19.5],
                    [now-60*base, 20.0],
                    [now-56*base, 20.5],
                    [now-52*base, 18.5],
                    [now-48*base, 19],
                    [now-44*base, 18.5],
                    [now-40*base, 21.5],
                    [now-36*base, 22.0],
                    [now-32*base, 19],
                    [now-28*base, 17.5],
                    [now-24*base, 16.5],
                    [now-20*base, 17.0],
                    [now-16*base, 18.5],
                    [now-12*base, 20.0],
                    [now-8*base, 19.5],
                    [now-4*base, 21.5],
                    [now-1*base, 21]
        ]
    }
]
return msg;